#include <stdio.h>
#include <limits.h>
#include <math.h>

struct Pos
{
	int x;
	int y;
	int operator- (const Pos& rhs) const
	{
		return (x - rhs.x) * (x - rhs.x) + (y - rhs.y) * (y - rhs.y);
	}
};

static const int V = 100;
Pos islands[V];
int G[V][V];

double Prim(int n)
{
	int* dist = G[0];
	int c = n;
	double amount = 0.0;
	while (--c)
	{
		int add, min = INT_MAX;
		for (int i = 1; i < n; ++i)
		{
			if (dist[i] != 0 && dist[i] < min)
			{
				add = i;
				min = dist[i];
			}
		}
		if (min == INT_MAX)
			return -1;
		amount += sqrt((double)min);
		dist[add] = 0;
		for (int i = 1; i < n; ++i)
		{
			if (G[add][i] < dist[i])
				dist[i] = G[add][i];
		}
	}
	return amount;
}

int main()
{
	int t;
	scanf ("%d", &t);
	while (t--)
	{
		int c;
		scanf ("%d", &c);
		for (int i = 0; i < c; ++i)
		{
			scanf ("%d %d", &islands[i].x, &islands[i].y);
			G[i][i] = 0;
			for (int j = 0; j < i; ++j)
			{
				int d = islands[i] - islands[j];
				if (d < 10 * 10 || d > 1000 * 1000)
					d = INT_MAX;
				G[i][j] = G[j][i] = d;
			}
		}

		double amount = Prim(c);
		if (amount == -1)
			printf ("oh!\n");
		else
			printf ("%.1lf\n", amount * 100);
	}
	return 0;
}